/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package pvt.delez.pam.virgin.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import pvt.delez.pam.PamPackage;

import pvt.delez.pam.impl.PamPackageImpl;

import pvt.delez.pam.virgin.BuildCommand;
import pvt.delez.pam.virgin.ClassPathDescriptor;
import pvt.delez.pam.virgin.ClassPathEntry;
import pvt.delez.pam.virgin.ClassPathEntryKind;
import pvt.delez.pam.virgin.ProjectDescriptor;
import pvt.delez.pam.virgin.VirginFactory;
import pvt.delez.pam.virgin.VirginPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class VirginPackageImpl extends EPackageImpl implements VirginPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass projectDescriptorEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass classPathDescriptorEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass buildCommandEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass classPathEntryEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum classPathEntryKindEEnum = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see pvt.delez.pam.virgin.VirginPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private VirginPackageImpl() {
		super(eNS_URI, VirginFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link VirginPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static VirginPackage init() {
		if (isInited) return (VirginPackage)EPackage.Registry.INSTANCE.getEPackage(VirginPackage.eNS_URI);

		// Obtain or create and register package
		VirginPackageImpl theVirginPackage = (VirginPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof VirginPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new VirginPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		PamPackageImpl thePamPackage = (PamPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(PamPackage.eNS_URI) instanceof PamPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(PamPackage.eNS_URI) : PamPackage.eINSTANCE);

		// Create package meta-data objects
		theVirginPackage.createPackageContents();
		thePamPackage.createPackageContents();

		// Initialize created meta-data
		theVirginPackage.initializePackageContents();
		thePamPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theVirginPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(VirginPackage.eNS_URI, theVirginPackage);
		return theVirginPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getProjectDescriptor() {
		return projectDescriptorEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getProjectDescriptor_Name() {
		return (EAttribute)projectDescriptorEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getProjectDescriptor_Projects() {
		return (EReference)projectDescriptorEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getProjectDescriptor_BuildCommands() {
		return (EReference)projectDescriptorEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getProjectDescriptor_Natures() {
		return (EAttribute)projectDescriptorEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getClassPathDescriptor() {
		return classPathDescriptorEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getClassPathDescriptor_ClassPaths() {
		return (EReference)classPathDescriptorEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBuildCommand() {
		return buildCommandEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getBuildCommand_Name() {
		return (EAttribute)buildCommandEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getBuildCommand_Arguments() {
		return (EAttribute)buildCommandEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getClassPathEntry() {
		return classPathEntryEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getClassPathEntry_Kind() {
		return (EAttribute)classPathEntryEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getClassPathEntry_Path() {
		return (EAttribute)classPathEntryEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getClassPathEntry_CombineAccessRules() {
		return (EAttribute)classPathEntryEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getClassPathEntryKind() {
		return classPathEntryKindEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VirginFactory getVirginFactory() {
		return (VirginFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		projectDescriptorEClass = createEClass(PROJECT_DESCRIPTOR);
		createEAttribute(projectDescriptorEClass, PROJECT_DESCRIPTOR__NAME);
		createEReference(projectDescriptorEClass, PROJECT_DESCRIPTOR__PROJECTS);
		createEReference(projectDescriptorEClass, PROJECT_DESCRIPTOR__BUILD_COMMANDS);
		createEAttribute(projectDescriptorEClass, PROJECT_DESCRIPTOR__NATURES);

		classPathDescriptorEClass = createEClass(CLASS_PATH_DESCRIPTOR);
		createEReference(classPathDescriptorEClass, CLASS_PATH_DESCRIPTOR__CLASS_PATHS);

		buildCommandEClass = createEClass(BUILD_COMMAND);
		createEAttribute(buildCommandEClass, BUILD_COMMAND__NAME);
		createEAttribute(buildCommandEClass, BUILD_COMMAND__ARGUMENTS);

		classPathEntryEClass = createEClass(CLASS_PATH_ENTRY);
		createEAttribute(classPathEntryEClass, CLASS_PATH_ENTRY__KIND);
		createEAttribute(classPathEntryEClass, CLASS_PATH_ENTRY__PATH);
		createEAttribute(classPathEntryEClass, CLASS_PATH_ENTRY__COMBINE_ACCESS_RULES);

		// Create enums
		classPathEntryKindEEnum = createEEnum(CLASS_PATH_ENTRY_KIND);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(projectDescriptorEClass, ProjectDescriptor.class, "ProjectDescriptor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getProjectDescriptor_Name(), ecorePackage.getEString(), "Name", null, 1, 1, ProjectDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getProjectDescriptor_Projects(), this.getProjectDescriptor(), null, "Projects", null, 0, 100, ProjectDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
		getProjectDescriptor_Projects().getEKeys().add(this.getProjectDescriptor_Name());
		initEReference(getProjectDescriptor_BuildCommands(), this.getBuildCommand(), null, "BuildCommands", null, 0, 100, ProjectDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
		initEAttribute(getProjectDescriptor_Natures(), ecorePackage.getEString(), "Natures", null, 0, 100, ProjectDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(classPathDescriptorEClass, ClassPathDescriptor.class, "ClassPathDescriptor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getClassPathDescriptor_ClassPaths(), this.getClassPathEntry(), null, "ClassPaths", null, 0, 100, ClassPathDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);

		initEClass(buildCommandEClass, BuildCommand.class, "BuildCommand", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getBuildCommand_Name(), ecorePackage.getEString(), "Name", null, 0, 1, BuildCommand.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		EGenericType g1 = createEGenericType(ecorePackage.getEMap());
		EGenericType g2 = createEGenericType();
		g1.getETypeArguments().add(g2);
		g2 = createEGenericType();
		g1.getETypeArguments().add(g2);
		initEAttribute(getBuildCommand_Arguments(), g1, "Arguments", null, 0, 1, BuildCommand.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);

		initEClass(classPathEntryEClass, ClassPathEntry.class, "ClassPathEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getClassPathEntry_Kind(), this.getClassPathEntryKind(), "Kind", null, 0, 1, ClassPathEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getClassPathEntry_Path(), ecorePackage.getEString(), "Path", null, 0, 1, ClassPathEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getClassPathEntry_CombineAccessRules(), ecorePackage.getEBoolean(), "CombineAccessRules", null, 0, 1, ClassPathEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);

		// Initialize enums and add enum literals
		initEEnum(classPathEntryKindEEnum, ClassPathEntryKind.class, "ClassPathEntryKind");
		addEEnumLiteral(classPathEntryKindEEnum, ClassPathEntryKind.SRC);
		addEEnumLiteral(classPathEntryKindEEnum, ClassPathEntryKind.CON);
		addEEnumLiteral(classPathEntryKindEEnum, ClassPathEntryKind.VAR);
	}

} //VirginPackageImpl
